Skip to content

Conversation

@ReaNAiveD
Copy link
Member

This is a very initial idea of a Local MCP server, which I name it "CLI as MCP".

Azure CLI could provide a command az mcp up to serve as a local MCP server through stdio.
Through this way, Azure CLI could integrate with VSCode Copilot Chat and other MCP client.

How to Install

Build the mcp server and install it as an Azure CLI extension.

azdev extension build mcp-server
az extension add --source azure-cli-extensions\src\mcp-server\dist\mcp_server-1.0.0b1-py3-none-any.whl

Enable MCP Server in VSCode

In VSCode, click the tools icon in Copilot Chat.
image
Select Add More Tools
image
Select Add MCP Server...
image
Select the Command(stdio) type
image
Input az mcp up to start the Local MCP Server
image

Enable MCP Server in VSCode (Alternative)

Add a new file named mcp.json in .vscode folder. Add the following config in this file:

{
	"servers": {
		"AzureLocalMcpServer": {
			"type": "stdio",
			"command": "az",
			"args": [
				"mcp",
				"up"
			]
		}
	},
	"inputs": []
}

How to use

After adding the Server, you should see two new tools in your toolset.
image

You can now use it in the Agent Mode!
image


This checklist is used to make sure that common guidelines for a pull request are followed.

Related command

az mcp up

General Guidelines

  • Have you run azdev style <YOUR_EXT> locally? (pip install azdev required)
  • Have you run python scripts/ci/test_index.py -q locally? (pip install wheel==0.30.0 required)
  • My extension version conforms to the Extension version schema

For new extensions:

About Extension Publish

There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update src/index.json automatically.
You only need to update the version information in file setup.py and historical information in file HISTORY.rst in your PR but do not modify src/index.json.

@ReaNAiveD ReaNAiveD self-assigned this Jul 29, 2025
@azure-client-tools-bot-prd
Copy link

Validation for Breaking Change Starting...

Thanks for your contribution!

@github-actions
Copy link

The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR.

Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions).
After that please run the following commands to enable git hooks:

pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>

@yonzhan
Copy link
Collaborator

yonzhan commented Jul 29, 2025

Thank you for your contribution! We will review the pull request and get back to you soon.

@github-actions
Copy link

Comment on lines 123 to 130
super().resource(
"az://{command_name_path}",
name="Azure CLI Command Help",
description="Retrieve comprehensive help documentation for Azure CLI commands and command groups. "
"Provides detailed information including command syntax, parameters, examples, and usage patterns. "
"Path format: 'az://command/subcommand' (e.g., 'az://login', 'az://vm/create', 'az://storage/account/list')",
mime_type="application/json",
)(self.command_help_resource)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't work because the implemetation of MCP python package has only very basic support of RFG 6570. modelcontextprotocol/python-sdk#378

@yonzhan yonzhan requested review from jsntcy and zhoxing-ms July 29, 2025 07:02
@mainred
Copy link
Member

mainred commented Oct 23, 2025

Can boost this work, AWS has released something similar

https://github.com/awslabs/mcp/tree/main/src/aws-api-mcp-server

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants